package com.mytx.sso.sms;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 配置管理类
 *
 * @author Administrator
 */
@Configuration
@ConfigurationProperties(prefix="smsapi")
public class ConfigManager {
    Logger logger = LoggerFactory.getLogger(ConfigManager.class);
    //接口
    public String masterUrl;

    public String backupUrl;
    // key
    public String apikey;
    //注册验证码模板
    public String registerSmsTemplate;
    //服务电话
    public String servicePhone;

    public String getMasterUrl() {
        return masterUrl;
    }

    public void setMasterUrl(String masterUrl) {
        this.masterUrl = masterUrl;
    }

    public String getBackupUrl() {
        return backupUrl;
    }

    public void setBackupUrl(String backupUrl) {
        this.backupUrl = backupUrl;
    }

    public String getRegisterSmsTemplate() {
        return registerSmsTemplate;
    }

    public void setRegisterSmsTemplate(String registerSmsTemplate) {
        this.registerSmsTemplate = registerSmsTemplate;
    }

    public String getServicePhone() {
        return servicePhone;
    }

    public void setServicePhone(String servicePhone) {
        this.servicePhone = servicePhone;
    }

    public String getApikey() {
        return apikey;
    }

    public void setApikey(String apikey) {
        this.apikey = apikey;
    }

    @Bean
    public RetrofitManager creatRetrofitManager() {
        return new RetrofitManager(masterUrl);
    }

}
